package com.yunlc.kubernetes.traefik.models;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

@ApiModel(description = "TraefikServiceSpec describes the IngressRoute the user wishes to exist.")
public class TraefikV1alpha1ServiceSpec {

    @SerializedName("weighted")
    private TraefikV1alpha1ServiceWeighted weighted = null;

    public TraefikV1alpha1ServiceSpec weighted(TraefikV1alpha1ServiceWeighted weighted) {
        this.weighted = weighted;
        return this;
    }

    @ApiModelProperty(value = "weighted")
    public TraefikV1alpha1ServiceWeighted getWeighted() {
        return weighted;
    }

    public void setWeighted(TraefikV1alpha1ServiceWeighted weighted) {
        this.weighted = weighted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TraefikV1alpha1ServiceSpec serviceSpec = (TraefikV1alpha1ServiceSpec) o;
        return Objects.equals(this.weighted, serviceSpec.weighted);
    }

    @Override
    public int hashCode() {
        return Objects.hash(weighted);
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class TraefikV1alpha1ServiceSpec {\n");

        sb.append("    weighted: ").append(toIndentedString(weighted)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
